package com.bf.electroplating.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bf.electroplating.pojo.dto.IdDTO;
import com.bf.electroplating.pojo.vo.ResultVO;
import com.bf.electroplating.pojo.vo.wasteGasMonitoringVO.WasteGasMonitoringDetailDTO;
import com.bf.electroplating.pojo.vo.wasteGasMonitoringVO.WasteGasMonitoringQueryDTO;
import com.bf.electroplating.pojo.vo.wasteGasMonitoringVO.WasteGasMonitoringVO;
import com.bf.electroplating.service.IWasteGasMonitoringService;
import com.bf.electroplating.util.idempotent.Idempotent;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 废气处理设施检测表 前端控制器
 * </p>
 *
 * @author gzd
 * @since 2025-08-22
 */
@Tag(name = "废气处理设施检测表")
@RestController
@RequestMapping("/electroplating/wasteGasMonitoring")
public class WasteGasMonitoringController {

    @Resource
    private IWasteGasMonitoringService wasteGasMonitoringService;

    @PostMapping( "/pageList" )
    @Operation( summary = "分页查询废气管理列表", description = "分页查询废气管理列表" )
    public ResultVO<Page<WasteGasMonitoringVO>> pageList (@RequestBody WasteGasMonitoringQueryDTO queryDTO ) {
        return wasteGasMonitoringService.pageList ( queryDTO );
    }


    @PostMapping ( "/detail" )
    @Operation ( summary = "获取废气管理详情", description = "获取废气管理详情" )
    public ResultVO < WasteGasMonitoringVO > getDetail ( @RequestBody WasteGasMonitoringDetailDTO idDTO ) {
        return wasteGasMonitoringService.getDetail ( idDTO );
    }


    @PostMapping ( "/export" )
    @Operation ( summary = "导出废气管理详情", description = "导出废气管理详情" )
    public void   export (HttpServletResponse httpServletResponse, @RequestBody WasteGasMonitoringDetailDTO idDTO ) throws IOException {
         wasteGasMonitoringService.export ( idDTO,httpServletResponse );
    }
    
}
